package com.xzz.thread.demo;

public class Producer implements Runnable{

    private int num ;
    private Warehouse warehouse;

    public Producer(Warehouse warehouse,int num) {
        this.warehouse = warehouse;
        this.num = num;
    }

    public int getNum() {
        return num;
    }
    @Override
    public void run() {
        warehouse.product(getNum());
    }
}
